home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / cdity / ModeProSrc.lha / Daemon / OldPatch / LayerHook.cold < prev    next >
Text File  |  1997-12-06  |  2KB  |  79 lines

  1. /*
  2. ** $VER: LayerHook.c 1.181 (19.3.95)
  3. **
  4. ** Tests backfill hooks in screens
  5. **
  6. ** (W) by Pierre Carrette & Walter Dörwald
  7. */
  8.  
  9. #include "ImageBackFill.h"
  10.  
  11. struct Screen *Scr;
  12. struct Window *Win;
  13.  
  14. UBYTE PubName[] = "BackFillHookTest";
  15.  
  16. struct BackFillOptions Options =
  17. {
  18.     256,256,
  19.     // !!! 0,0,
  20.     TRUE,FALSE,
  21.     0,0,
  22.     TRUE
  23. };
  24.  
  25. struct BackFillInfo BFInfo;
  26.  
  27. long main(int argc,char *argv[])
  28. {
  29.     static UWORD Pens[] = { (UWORD)~0 };
  30.     LONG OldMode;
  31.  
  32.     if (argc<=1)
  33.     {
  34.         printf("Usage:\n"
  35.                "\t%s FILENAME/A",argv[0]);
  36.         exit(5);
  37.     }
  38.     if (Scr = OpenScreenTags(NULL,SA_LikeWorkbench,TRUE,
  39.                                   SA_Title        ,"Backfillhook Test - Break me to finish",
  40.                                   SA_Interleaved  ,TRUE,
  41.                                   SA_Overscan     ,OSCAN_TEXT,
  42.                                   SA_Pens         ,Pens,
  43.                                   SA_SharePens    ,TRUE,
  44.                                   SA_PubName      ,PubName,
  45.                                   TAG_DONE))
  46.     {
  47.         if (LoadBackgroundImage(&BFInfo,argc>1 ? argv[1] : "SYS:Prefs/Patterns/Pflaster",Scr,&Options))
  48.         {
  49.             if (Win = OpenWindowTags(NULL,
  50.                                      WA_Left        ,0,
  51.                                      WA_Top         ,Scr->BarHeight+1,
  52.                                      WA_Width       ,Scr->Width,
  53.                                      WA_Height      ,Scr->Height-Scr->BarHeight-1,
  54.                                      WA_Flags       ,WFLG_BACKDROP|WFLG_BORDERLESS|WFLG_SIMPLE_REFRESH|WFLG_NOCAREREFRESH,
  55.                                      WA_CustomScreen,Scr,
  56.                                      WA_BackFill    ,&BFInfo,
  57.                                      TAG_DONE))
  58.             {
  59.                 PubScreenStatus(Scr,0L); /* Make Screen Public */
  60.                 OldMode = SetPubScreenModes(SHANGHAI);
  61.                 SetDefaultPubScreen(PubName);
  62.  
  63.                 Wait(SIGBREAKF_CTRL_C);
  64.  
  65.                 SetPubScreenModes(OldMode); /* Make WorkBench become Default Pub Screen again */
  66.                 SetDefaultPubScreen(NULL);
  67.  
  68.                 while (!(PubScreenStatus(Scr,PSNF_PRIVATE)&0x1))
  69.                     Delay(50L);
  70.                 CloseWindow(Win);
  71.             }
  72.             UnloadBackgroundImage(&BFInfo);
  73.         }
  74.         while (!CloseScreen(Scr))
  75.             Delay(50L);
  76.     }
  77.     return 0;
  78. }
  79.